<%@ page language="java" contentType="text/html; charset=windows-1255"
    pageEncoding="windows-1255"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
		<title>Welcome To Course management Site</title>
	</head>
	<body>
		<%String login = (String)request.getSession().getAttribute("username");
		  if (login != null) {
			 response.sendRedirect("Web/hello.html");
		  }
	     %>
		<div id="Login Form">	
			<h2>Please enter user name and password to login</h2>
			<form action="Login" method="POST">
  				<table>
					<tr>
						<td>User Name:</td>
						<td><input type="text" name="username" /></input></td>
					</tr>
					<tr>
						<td>User Password:</td>
						<td><input type="password" name="password" /></input></td>
					</tr>
  				</table>
				<h3><input type="submit" value="Login"></input></h3>
			</form>
			<button onClick="window.location='registration.jsp'">Create an account</button>
		</div>
		
		<%  String LastResultFailed = (String)request.getSession().getAttribute("LastResultFailed");
			if (LastResultFailed != null) { %>
				<script type="text/javascript"> 
					alert("Login Failed!\n"+
						  "Please check your username and password"); 
				</script>
		<% 		request.getSession().removeAttribute("LastResultFailed");
			}
		%>
		
	</body>
</html>
